<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:util="http://java.sun.com/jsf/composite/util"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:a4j="http://richfaces.org/a4j">


<ui:composition>
	<h:panelGrid columns="2"
		columnClasses="firstGetAddressColumn, secondGetAddressColumn">
		<h:panelGroup>
			<h:form>
			Podaj dane do wysyłki zamówinia:
			<rich:panel>
					<h:panelGrid columns="1">
						<util:formField
							beanProperty="#{clientRegisterBean.client.first_name}"
							title="#{msgs.addressShoppingFIRST_NAME_FIELD}" size="48"
							required="true" />
						<util:formField
							beanProperty="#{clientRegisterBean.client.last_name}"
							title="#{msgs.addressShoppingLAST_NAME_FIELD}" size="49"
							required="true" />
						<br />
						<h:outputText value="#{msgs.addressShoppingADDRESS_FIELD}"
							style="font-size: 14px;" />
						<util:formField beanProperty="#{clientRegisterBean.client.street}"
							title="#{msgs.addressShoppingSTREET_FIELD}" size="50"
							required="true" />
						<h:panelGrid columns="2" cellpadding="2">
							<util:formField
								beanProperty="#{clientRegisterBean.client.house_number}"
								title="#{msgs.addressShoppingHOUSE_NUMBER_FIELD}" size="20"
								required="true" />
							<util:formField
								beanProperty="#{clientRegisterBean.client.apartment_number}"
								title="#{msgs.addressShoppingAPARTMENT_NUMBER_FIELD}" size="20"
								required="true" />
						</h:panelGrid>
						<util:formField beanProperty="#{clientRegisterBean.client.post}"
							title="#{msgs.addressShoppingPOST_FIELD}" size="30"
							required="true" />
						<util:formField
							beanProperty="#{clientRegisterBean.client.postal_code}"
							title="#{msgs.addressShoppingPOSTAL_CODE_FIELD}" size="30"
							required="true" />
						<br />

						<h:outputText value="#{msgs.addressShoppingCONTACT_FIELD}"
							style="font-size: 14px;" />
						<util:formField beanProperty="#{clientRegisterBean.client.email}"
							title="#{msgs.addressShoppingEMAIL_FIELD}" size="50"
							required="true" />
						<util:formField beanProperty="#{clientRegisterBean.client.phone}"
							title="#{msgs.addressShoppingPHONE_FIELD}" size="50"
							required="true" />
						<br />
					</h:panelGrid>

					<t:div style="text-align:center;">
						<h:commandButton value="#{msgs.addressShoppingBUY_BUTTON}"
							actionListener="#{clientRegisterBean.createOrderClient}"
							action="#{jsfutils.redirect('mainContent/confirmationShoppingPage')}" />
						<h:commandButton value="#{msgs.addressShoppingCANCEL_BUTTON}"
							action="#{jsfutils.redirect('mainContent/booksTablePage')}" />

					</t:div>
				</rich:panel>
			</h:form>
		</h:panelGroup>
		<h:panelGroup>
			<h:form>
			Jeżeli jesteś zerejestrowany, wystarczy się zalogować:
				<br />
				<br />
				<h:outputText value="Login:" />

				<h:inputText value="#{clientLoginBean.login}"
					rendered="#{!clientLoginBean.logged}" />
				<br />
				<h:outputText value="Hasło:" />
				<h:inputSecret value="#{clientLoginBean.password}" />
				<br />
				<h:commandButton value="Zaloguj" action="#{clientLoginBean.login}"
					actionListener="#{clientLoginBean.toConfirmAddressPage}" />
			</h:form>
		</h:panelGroup>
	</h:panelGrid>
</ui:composition>
</html>
